package com.consumer.demo.controller;

import com.consumer.demo.service.CMainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/main")
public class CMainController {

    @Autowired
    private CMainService cMainService;

    @PostMapping("/index")
    public String index(){
        return cMainService.index("测试数据发送！");
    }

    @GetMapping("/test")
    public String test(){
        System.out.println("-------------进入方法了-------------");
        cMainService.index("测试数据发送！");
        return "测试get方法！";
    }

}
